package com.grape.dao.base;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.grape.domain.base.Courier;

public interface CourierRepository extends JpaRepository<Courier, Integer> ,JpaSpecificationExecutor<Courier>{
	
	@Modifying
	@Query(value="update Courier set deltag=1  where id=?")
	void updateDelTag(Integer id);

	@Modifying
	@Query(value="update Courier set deltag=null  where id=?")
	void updateRestoreTag(Integer id);

	@Query(value="from Courier c where c.fixedAreas is empty")
	List<Courier> findNoAssaciation();

}
